package com.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    /**
     * 查询数据库用户名是否存在
     * @param username
     * @return
     */
    @Select("select count(*) from user where username=#{username} limit 1")
    int count(String username);
}
